package com.wench.design.pattern.singleton;

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;

/**
 * 单例设计模式在JDK中的应用 --> RunTime 类
 *
 * @author wench
 */
public class RuntimeDemo {

    public static void main(String[] args) throws IOException {
        Runtime runtime = Runtime.getRuntime();
        Process process = runtime.exec("pwd");
        InputStream inputStream = process.getInputStream();
        byte[] arr = new byte[1024 * 1024 * 100];
        int len = inputStream.read(arr);
        System.out.println(new String(arr, 0, len, StandardCharsets.UTF_8));
    }
}
